package com.guestbook;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {
    private EditText msgContent = null;
    private TextView msgDisplay = null;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        msgContent = (EditText) findViewById(R.id.editText);
        msgDisplay = (TextView) findViewById(R.id.greetingmsg);
    }

    public void btnHandler(View v){
        int id = v.getId();
        if(id==R.id.button){
            String msgText = msgContent.getText().toString();
            msgDisplay.setText("Hello, "+msgText);
        }
    }
}
